package com.xbongbong.workflow.pojo.nodes;

import com.xbongbong.paas.domain.entity.ext.FieldPermissionEntityExt;
import com.xbongbong.paas.field.FilterConditionsPoJo;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.Size;
import java.util.List;
import java.util.Map;

/**
 * @author chenpeng
 * @version 1.0
 * @date 2021-05-10 14:54
 * @description 表单触发节点
 */
@Getter
@Setter
public class FormTriggerNode {
    
    /**
     * 需审批字段
     */
    private List<String> needApproveFields;

    /**
     * 触发方式
     * @see com.xbongbong.pro.enums.workflow.TriggerEventTypeEnum
     */
    private Integer type;

    /**
     * 字段权限
     */
    @Valid
    private Map<String, FieldPermissionEntityExt> fieldPermission;

    /**
     * 触发条件，可能是没有条件的，最多5条
     */
    @Size(max = 5, message = "{pojo.msg.ActiveRule.rulePojo.triggerConditions.Size}")
    private List<FilterConditionsPoJo> triggerConditions;

    /**
     * 审批标题
     */
    private List<WorkflowTitlePojo> titleList;

}
